package com.wf.it.common.api;


import com.wf.it.common.api.hystrix.BookServiceHystrixImpl;
import com.wf.it.common.entity.Book;
import com.wf.it.common.vo.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(value = "hp-plan",fallback = BookServiceHystrixImpl.class)
public interface BookService {
    @PostMapping("/book/add")
    public Result<Book> addBook(@RequestParam("planid") int planid
            ,@RequestParam("userIdCard") String userIdCard
            ,@RequestParam("money")int money
    );
    @PostMapping("/book/findbyuser")
    Result<List<Book>> findListByUser(@RequestParam("userIdCard")String userIdCard);

    @GetMapping("/book/findbyid")
    Result<Book> findById(@RequestParam("bookid")int bookid);
    @PostMapping("/book/cancel")
    Result cancelBook(@RequestParam("bookid")int bookid);
}
